<?php
  /*GroupMember.php
  * Links an employee to a group as a member
  * Managers of the linked group are able to modify data of this employee
  */
class GroupMember extends AppModel
{
    var $name = 'GroupMember';
    var $primaryKey = 'id';
    //validation rules
        var $validate = array(
	'group_id'=> array(
		'rule'=>'numeric',
		'required'=>true
	),
	'emp_id'=> array(
		'rule'=>'numeric',
		'required'=>true
	)
        );

}

public function deleteById($id)
    {
    	if($this.emp_id==$id){
		$this->delete($this.id,true);
	}

    }

?>
